#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include <stdio.h>
#include<stdlib.h>
typedef struct Node {
    int x;
    struct Node* next;
}Node;
int main() {
    long a;
    long b = 0;
    Node* head = (Node*)malloc(sizeof(Node));
    head->next = NULL;
    scanf("%ld", &a);
    while (a)
    {
        b = a % 10;
        Node* cur = (Node*)malloc(sizeof(Node));
        cur->x = b;
        cur->next = head->next;
        head->next = cur;
        a = a / 10;
    }
    Node* cur = (Node*)malloc(sizeof(Node));
    int count = 3;
    cur = head->next;
    while (cur)
    {
        printf("%d", cur->x);
        count--;
        cur = cur->next;
        if (count == 0)
        {
            printf(",");
            count = 3;
        }
    }

    return 0;
}

